package com.example.echoewish.repository.network.service;

import com.example.echoewish.pojo.DetailPost;
import com.example.echoewish.pojo.HotSearch;
import com.example.echoewish.pojo.MyPublishPost;
import com.example.echoewish.pojo.PartPost;
import com.example.echoewish.pojo.Post;

import java.util.List;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface PostService {

    @POST("post/publish")
    Call<ResponseBody> publishPost(@Body RequestBody fileAndData);

    @GET("post/delete")
    Call<ResponseBody> deletePost(@Query("postId")int postId);

    @GET("post/query")
    Call<Post> queryPost(@Query("postId")int postId);

    @GET("post/queryDetailPost")
    Call<DetailPost> queryDetailPost(@Query("postId")int postId);

    @GET("post/queryPartPost")
    Call<List<PartPost>> queryPartPost(@Query("start")int start,@Query("end") int end);

    @GET("post/queryPartPostByZone")
    Call<List<PartPost>> queryPartPostByZone(@Query("start")int start,@Query("end") int end,@Query("zone") String zone);

    @GET("post/queryPartPostByKeyWord")
    Call<List<PartPost>> queryPartPostByKeyWord(@Query("keyword")String keyword);

    @GET("post/queryPartPostByZoneAndKeyWord")
    Call<List<PartPost>> queryPartPostByZoneAndKeyWord(@Query("zone") String zone,@Query("keyword")String keyword);

    @GET("post/queryMyPublishPostByUserId")
    Call<List<MyPublishPost>> queryMyPublishPostByUserId(@Query("userId")int userId);

    @GET("post/getHotSearch")
    Call<List<HotSearch>> getHotSearch(@Query("num")int num);
}
